{php}
$header_background_image='/report/images/top_logo_banner.gif';
$this->assign('header_background_image', $header_background_image);

BizSystem::clientProxy()->includeCKEditorScripts();
//BizSystem::clientProxy()->includeColorPickerScripts();

$includedScripts = BizSystem::clientProxy()->getAppendedScripts();
$includedScripts.="\n".'
<script type="text/javascript" src="'.$this->_tpl_vars['js_url'].'/FusionCharts/FusionCharts.js"></script>
<script type="text/javascript" >forceSelectRecord=true;</script>
';
$left_menu = "report.widget.ReportMenu";
$this->assign('left_menu', $left_menu);
$this->_tpl_vars['scripts'] = $includedScripts;
$appendStyle = BizSystem::clientProxy()->getAppendedStyles();
$this->_tpl_vars['style_sheets'] = $appendStyle;
{/php}

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{$title}</title>
<meta name="description" content="{$description}"/>
<meta name="keywords" content="{$keywords}"/>
<link rel="stylesheet" href="{$css_url}/general.css" type="text/css" />
<link rel="stylesheet" href="{$css_url}/system_backend.css" type="text/css" />
<link rel="stylesheet" href="{$css_url}/system_backend_tabs.css" type="text/css" />
{$style_sheets}
{$scripts}

<script type="text/javascript" src="{$js_url}/jstree/_lib.js"></script>
<script type="text/javascript" src="{$js_url}/jstree/tree_component.js"></script>
<script type="text/javascript" src="{$theme_js_url}/general_ui.js"></script>
<script type="text/javascript" src="{$js_url}/cookies.js"></script>


<script type='text/javascript' src='{$js_url}/colorpicker/js/eye.js'></script>
<script type='text/javascript' src='{$js_url}/colorpicker/js/utils.js'></script>
<script type='text/javascript' src='{$js_url}/colorpicker/js/colorpicker.js'></script>
<link rel="stylesheet" href="{$js_url}/colorpicker/css/colorpicker.css" type="text/css">


<script>var $j = jQuery.noConflict();</script>



</head>

<body>
<div align="center" id="body_warp">
	<div id="header_warp">
	{include file='system_header.tpl.html'}
	</div>
	<!--main warp-->
	<div id="main_warp">	
		<!--main-->
		<div id="main" >
			
			{include file='system_loader.tpl.html'}
				<table id="main_content" border="0" cellpadding="0" cellspacing="0">
					<tr><td><img src="{$image_url}/spacer.gif" style="height:15px;" /></td></tr>
					<tr>
						<td valign="top" style="width:18px;"><img src="{$image_url}/spacer.gif" style="width:18px;" /></td>
						<td valign="top" id="left_panel">
								<!-- left menu block start -->								

								<div class="content_block">
									<div class="header"></div>
									<div class="content_tree" >
										{assign var='folderTree' value='report.folder.form.FolderTree'}
										{$forms.$folderTree}
									</div>
									<div class="footer"></div>						
								</div>
								<div class="v_spacer"></div>
								<!-- left menu block end -->	
								<div class="content_block">
									<div class="header"></div>
									<div class="content" >		
{php}
$left_menu = $this->_tpl_vars['left_menu'];
$obj = Bizsystem::GetObject($left_menu);
$left_menu_content = $obj->render();
$this->assign('system_left_menu_content', 	$left_menu_content);
{/php}																	
										{$system_left_menu_content}
									</div>
									<div class="footer"></div>						
								</div>
								<div class="v_spacer"></div>																					
								<!-- left help block start -->
								<div class="content_block_dark">
									<div class="header">								
									</div>
									<div class="content" >
									{php}echo Bizsystem::GetObject('help.form.HelpWidgetListForm',1)->render();{/php}
									</div>
									<div class="footer"></div>						
								</div>
								<div class="v_spacer"></div>
								<!-- left help block end -->			
						</td>
						<td valign="top" id="right_panel">
							<!-- right block start -->
							<div class="content_block">
								<div class="header"></div>
								<div class="content">	
									<div>
										<ul id="tabs_selector">
											{foreach key=formname name=tabs item=formtitle from=$formtabs}	
										    	{if $formname !='help.form.HelpBlockForm' and  
										    	$formname !='report.folder.form.FolderTree' and
										    		'/^menu\.widget\..*Menu$/si'|preg_match:$formname eq 0}							    
										         <li id="tab_{$formname}" class="tab_link">
										         	<a id="tab_link_{$formname}" href="javascript:" onclick="ShowTab('{$formname}');SwitchTab();">{$formtitle}</a>
										         </li>
										       {/if}
										    {/foreach}										
										</ul>
														
									{foreach key=formname item=form from=$forms}	
								    	{if $formname !='help.form.HelpBlockForm' and  
								    		$formname !='report.folder.form.FolderTree' and
								    		'/^menu\.widget\..*Menu$/si'|preg_match:$formname eq 0}							    
								         <div id="tab_form_{$formname}" class="tab_form" >
								         	<div>
								         	{$form}
								         	</div>
								         </div>
								       {/if}
								    {/foreach}	
								    	
									</div>									
								</div>
								<div class="footer"></div>														
							</div>
							<!-- right block end -->
						</td>
					</tr>
			  </table>		  
			</div>
			<!--main-->
		
		</div>		
		<!--main wrap end-->
		<!--footer-->
		<div  id="footer_warp">			
 		{include file='system_footer.tpl.html'}
		</div>
		<!-- footer end -->
	
	</div>
</div>

{literal}
<script>
$('main_loader_bg').style.height = $('main_content').offsetHeight+'px';
document.observe("Form:Load",SwitchTab);
var targetTabname;
function SwitchTab(){
	if(targetTabname){
		HideTabs();
		$('tab_form_'+targetTabname).show();
		$('tab_form_'+targetTabname).style.display='block';
		$('tab_link_'+targetTabname).className='current';
	}	
}
function ShowTab(tabname,formname,id){	
	targetTabname = tabname;
	//Openbiz.CallFunction(formname+'.SelectRecord('+id+')');	
//	if(formname){	
//		if(Openbiz.getFormObject(formname).selectedId == Openbiz.getFormObject(formname).lastSelectedId){
//			SwitchTab();
//		}	
//	}
}
function HideTabs(){
	var tabs = $$('.tab_form');	
	for(i=0;i<tabs.length;i++) {	
	    tabs[i].style.display='none';	    
	}	

	var tab_links = $$('.tab_link');
	for(i=0;i<tab_links.length;i++) {
		tab_links[i].children[0].className='';
	}
}
function InitTabs(){
	fade_loader();
	var tabs = $$('.tab_form');
	for(i=0;i<tabs.length;i++) {	
	    tabs[i].style.display='none'; 		  
	}
	tabs[0].style.display='block';

	var tab_links = $$('.tab_link');
	for(i=0;i<tab_links.length;i++) {
		tab_links[i].children[0].className='';
	}
	tab_links[0].children[0].className='current';
//	window.setTimeout("init_first_tab()",1500);
}
window.onload=InitTabs;

//edit report elements functions
function showElementConfigOptions(type){
	switch(type){
		case 'report.lib.ChartCategory': 
		case 'report.lib.ChartData': 
			hideElementConfigOptions();
			break;
		case 'InputText': 
		case 'Listbox': 
		case 'Checkbox':
		case 'Radio':
		case 'InputDate':
		case 'AutoSuggest':
			hideElementConfigOptions();
			$('fld_attr_selfrom_container').show();
			break;			
		default:
			hideElementConfigOptions();
			$('fld_attr_font_width_container').show();	
			$('fld_attr_font_height_container').show();
			$('fld_attr_font_weight_container').show();	
			$('fld_attr_font_style_container').show();
			$('fld_attr_text_decoration_container').show();
			$('fld_attr_align_container').show();
			$('fld_attr_font_size_container').show();
			$('fld_attr_color_container').show();
			$('fld_attr_bgcolor_container').show();
			
			break;
	}
}

function hideElementConfigOptions(){
	$('fld_attr_font_width_container').hide();	
	$('fld_attr_font_height_container').hide();
	$('fld_attr_font_weight_container').hide();	
	$('fld_attr_font_style_container').hide();
	$('fld_attr_text_decoration_container').hide();
	$('fld_attr_align_container').hide();
	$('fld_attr_font_size_container').hide();
	$('fld_attr_color_container').hide();
	$('fld_attr_bgcolor_container').hide();
	$('fld_attr_selfrom_container').hide();
}

//edit report form functions
function showConfigOptions(type){
	switch(type){
		case 'chart':
			hideConfigOptions();
			$('fld_subtype_container').show();
			$('fld_width_container').show();
			$('fld_height_container').show();
			$('fld_show_hover_cap_container').show();
			$('fld_show_label_container').show();
			$('fld_show_value_container').show();
			$('fld_show_number_prefix_container').show();
			$('fld_show_number_suffix_container').show();
			$('fld_show_format_number_container').show();
			$('fld_show_number_scale_container').show();
			showSubConfigOptions($('fld_subtype').value);
			break;
			
		case 'table':
			hideConfigOptions();			
			$('fld_template_container').show();
			$('fld_pagesize_container').show();
			break;

		case 'filter':
			hideConfigOptions();
	}	
}

function showSubConfigOptions(type){
	hideConfigOptions();
	$('fld_subtype_container').show();
	
	$('fld_width_container').show();
	$('fld_height_container').show();
	$('fld_show_hover_cap_container').show();
	$('fld_show_label_container').show();
	$('fld_show_value_container').show();
	$('fld_show_number_prefix_container').show();
	$('fld_show_number_suffix_container').show();
	$('fld_show_format_number_container').show();
	$('fld_show_number_scale_container').show();	
	switch(type){
		case 'StackedColumn2D':
		case 'MSColumn2D':
			$('fld_show_legend_container').show();
		case 'Column2D':
			$('fld_show_limits_container').show();
			$('fld_show_rotate_name_container').show();
			$('fld_y_min_value_container').show();
			$('fld_y_max_value_container').show();
			$('fld_show_column_shadow_container').show();
			$('fld_show_animation_container').show();
			break;

		case 'StackedColumn3D':			
		case 'MSColumn3D':
			$('fld_show_legend_container').show();			
		case 'Column3D':
			$('fld_show_limits_container').show();
			$('fld_show_rotate_name_container').show();
			$('fld_y_min_value_container').show();
			$('fld_y_max_value_container').show();
			$('fld_show_animation_container').show();
			break;

		case 'StackedBar2D':
		case 'MSBar2D':
			$('fld_show_legend_container').show();				
		case 'Bar2D':
			$('fld_show_limits_container').show();
			$('fld_show_rotate_name_container').show();
			$('fld_y_min_value_container').show();
			$('fld_y_max_value_container').show();
			$('fld_show_column_shadow_container').show();
			$('fld_show_animation_container').show();
			$('fld_show_bar_shadow_container').show();
			break;

		case 'StackedArea2D':			
		case 'MSArea2D':
			$('fld_show_legend_container').show();				
		case 'Area2D':
			$('fld_show_limits_container').show();
			$('fld_show_rotate_name_container').show();
			$('fld_y_min_value_container').show();
			$('fld_y_max_value_container').show();
			$('fld_show_column_shadow_container').show();
			$('fld_show_animation_container').show();
			$('fld_show_area_border_container').show();
			$('fld_show_area_alpha_container').show();
			break;

		case 'MSLine':
			$('fld_show_legend_container').show();				
		case 'Line':
			$('fld_show_limits_container').show();
			$('fld_show_rotate_name_container').show();
			$('fld_y_min_value_container').show();
			$('fld_y_max_value_container').show();
			$('fld_show_column_shadow_container').show();
			$('fld_show_animation_container').show();
			$('fld_show_anchor_container').show();
			$('fld_show_anchor_radius_container').show();
			break;
		case 'Pie2D':
			$('fld_show_percentage_value_container').show();	
			$('fld_show_percentage_in_label_container').show();
			$('fld_show_shadow_container').show();
			$('fld_show_animation_container').show();
			$('fld_show_pie_radius_container').show();
			break;
		case 'Pie3D':
			$('fld_show_percentage_value_container').show();	
			$('fld_show_percentage_in_label_container').show();
			$('fld_show_pie_radius_container').show();
			$('fld_show_pie_y_scale_container').show();
			$('fld_show_pie_slice_depth_container').show();
			break;
			

	}
}

function hideConfigOptions(){
	$('fld_pagesize_container').hide();	
	$('fld_template_container').hide();	
	$('fld_subtype_container').hide();
	$('fld_width_container').hide();
	$('fld_height_container').hide();
	$('fld_show_label_container').hide();
	$('fld_show_value_container').hide();
	$('fld_show_hover_cap_container').hide();
	$('fld_show_number_prefix_container').hide();
	$('fld_show_number_suffix_container').hide();
	$('fld_show_format_number_container').hide();
	$('fld_show_number_scale_container').hide();		
	$('fld_show_percentage_value_container').hide();	
	$('fld_show_percentage_in_label_container').hide();
	$('fld_show_pie_radius_container').hide();
	$('fld_show_pie_y_scale_container').hide();
	$('fld_show_pie_slice_depth_container').hide();
	$('fld_show_shadow_container').hide();
	$('fld_show_animation_container').hide();
	$('fld_show_limits_container').hide();
	$('fld_show_rotate_name_container').hide();
	$('fld_y_min_value_container').hide();
	$('fld_y_max_value_container').hide();
	$('fld_show_column_shadow_container').hide();
	$('fld_show_anchor_container').hide();
	$('fld_show_anchor_radius_container').hide();
	$('fld_show_bar_shadow_container').hide();
	$('fld_show_area_border_container').hide();
	$('fld_show_area_alpha_container').hide();
	$('fld_show_legend_container').hide();
}
</script>
{/literal}
</body>
</html>